package observer;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;

public class ValoareCurentaBara extends Canvas implements Observer{
	private int ultimaVal = 0;
	
	//Notifica ob_le at cand se face o schimbare
		public void upDate(Subject s){
			ultimaVal= s.getVal();
			repaint();
		}
			
		//Updateaza interfata grafica
		public void update(Graphics g){
			super.update(g);
		}
		
		//Deseneaza obiectele
		public void paint(Graphics g){
			g.drawRect(0, 0, 80, 20);
			g.setColor(Color.blue);
			g.fillRect(0, 0, ultimaVal, 20);
		}
		

}
